(function(){
	var Page = {
		init:function(){
			this.render();
			this.event();
		},
		//绑定事件
		event:function(){$(".btnlogin").click(function(){
				var accountName=$(".accountName").val()
				var password=$(".password").val()
				if(accountName==""){alert("请输入用户名");return}
				if(password==""){alert("请输入密码");return}
				$.ajax({
					url:'http://web.icecn.net/index/login.json',
					type:'POST',
					async:true,
					data:{
						accountName:accountName,
						password:password
					},
					xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
						if(data.code === 200 ){
							var user=JSON.stringify(data.t); 
							sessionStorage.setItem("backUserInfo", user);
							window.location.href ='web/html/AccountManagement/AccountUser.html';
						}else{
							alert(data.msg)	
						}
					}
				 });
			})
		},
		//渲染页面
		render:function(){
		}
	};
	Page.init();
})();